Electronic flash memory external storage method and device

ABSTRACT

An electronic flash memory external storage method and device for data processing system includes firmware which directly controls the access of electronic storage media and implements standard interface functions, adopts particular reading and writing formats of the external storage media, receives power via USB, externally stores data by flash memory and access control circuit with the cooperation of the firmware and the driver with the operating system, and has write-protection so that the data can be safely transferred. The method according to present invention is highly efficient and all parts involved are assembled as a monolithic piece so that it has large-capacity with small size and high speed. The device operates in static state and is driven by software. It is plug-and-play and adapted to data processing system.

RELATED APPLICATION

This application is a continuation of U.S. application Ser. No.13/283,120 filed on Oct. 27, 2011, which is a continuation of U.S.application Ser. No. 12/436,636 filed on May 6, 2009, now U.S. Pat. No.8,074,424; which is a divisional application of U.S. application Ser.No. 10/897,519 filed on Jul. 24, 2004, now U.S. Pat. No. 7,788,447;which is a divisional application of U.S. application Ser. No.09/687,869 filed on Oct. 13, 2000, now U.S. Pat. No. 6,29,672. Theteachings of these applications are incorporated by reference herein intheir entirety.

FIELD OF THE INVENTION

This invention is related to storage device for data processing system,especially related to external storage method and its device for micro,handheld and portable data processing systems.

BACKGROUND OF THE INVENTION

Since the invention of computer, people have been paying close attentionto the improvement of computer external storage device, from magneticdrum, magnetic tape to floppy disk and hard disk to exchange, save andbackup data and file. For more than a decade, personal computertechnology has been improved quickly, but the technology of floppy diskas a removable external storage has no substantial improvement. The onlyimprovement of floppy disk is that the size was reduced from 8 inches,to 5.25 inches, and to 3.5 inches, and the capacity was increased to1.44 MB. Other than the above improvements, the floppy disk technologystays as what it was ten years ago and there is no further improvement.As we all know, floppy disk has the following disadvantages: smallcapacity, low speed, easy to be damaged, low reliability. Especially,floppy disk drive is big and heavy. All these disadvantages have causedgreat inconvenience to users. In the past few years, there are someother storage devices in the market, such as high-capacity ZIP disk,removable optic disc MO etc. These devices have some advantages thatfloppy disk does not have, such as larger capacity, better reliabilitythan floppy disk, etc. But they still have such disadvantages: big,heavy, requiring physical drive, difficult to carry, complicated to use,requiring external power supply, hard to popularize, high price and soon. Only very small number of computers are equipped with physicaldrives for such storage devices. In addition, in order to install suchan internal drive, you must turn off the computer, open computer casingand find a place in the computer to mount it. Then you need to close thecasing, power on your computer and install software driver for thedevice. You can not use the device until all the above steps have beenfinished. Obviously, ordinary computer users, even computer specialistsmay find such storage devices too troublesome to use, not to mentionthose users who are not familiar with computers.

To sum up, a new kind of computer storage device is urgently needed toreplace or complement floppy disk and other external storage deviceusing existing technology. The need is especially urgent for thoseincreasingly popular notebooks and handheld devices. Floppy disk driveand other physical drives, due to their big size and heavy weight, arenot suitable for notebooks and handheld devices which must be light,convenient, small and portable. In fact, more and more notebooks don'thave build-in floppy disk drive or CDROM drive for the purposes ofcompactness and convenience.

Universal Serial Bus (USB) is a new computer technology in recent years.Its standard is defined by some international big companies such asIntel, Microsoft and Compaq etc. The purposes of USB are to make the useof personal computers simpler, easier and faster, and to replaceexisting serial port, parallel port and keyboard port etc. Today, allPentium II or above computers (including compatible computers) areequipped with USB. USB has become a new industry standard for personalcomputer. There may be some other high-speed universal bus standards inthe future.

At the time when USB is widely available today, users can no longertolerate the situation that micro or portable data processing devicescan not install built-in floppy disk or other similar storage devices.Users also can hardly tolerate low-capacity, low-speed and vulnerablestorage devices like floppy disk, especially can not tolerate thedefects that drives for such devices are big and hard to install.

SUMMARY OF THE INVENTION

The present invention provides an electronic flash memory externalstorage method to overcome the shortages of current storage technology.The method uses electronic flash memory, standard universal bus andplug-and-play technology to provide a new external storage device tocomputer users. All parts and PCB of the external storage device areassembled as a monolithic piece. The high-capacity and high-speed deviceis simple, light, convenient, portable, easy to use and highly reliable.The invention only uses software to implement external storage functionsand can be implemented on different operating system. It is applicableto various data processing systems supporting standard universal bus.

The objects of the present invention are accomplished by the followingtechnical scheme:

The scheme adopts an electronic flash memory external storage methodthat includes the use of DC power supply and storage media, and has thefollowing characteristics:

-   -   said storage media is flash memory,    -   all components and PCB (printed circuit board) used are        assembled as a monolithic piece,    -   said storage method uses software to implement external storage        functions (to replace physical drive), and    -   every part is physically at a standstill during the process of        access.

Said external storage method involves flash memory and the connectinguniversal bus interface controller, microprocessor and suspend/resumecircuit. The external storage device is connected with data processingsystem through universal bus interface. The firmware of the externalstorage device is designed inside the microprocessor. Afterinitialization, the firmware can process standard interface operationrequests and special operation requests to the external storage device.After processing the requests, the firmware sends the results back tothe requesters. Meanwhile, the driver of the external storage device isimplemented and installed in the operating system. The driver isinitialized when the external storage device is plugged into hostcomputer. During initialization, the driver instructs upper layer of theoperating system to generate a removable drive for the external storagedevice and assign a corresponding device symbol for it. Afterwards, inresponse to conventional magnetic disk operation requests, the driverconverts these requests into special instructions for the externalstorage device. The driver then sends the converted instructions to thefirmware of the external storage device through bottom layer operatingsystem and universal bus interface control circuit. The firmwareexecutes the instructions and sends results and status back to thedriver through the operating system. There are two categories ofinstructions for the external storage device: read and write. Due to thecharacteristic that valid data of the flash memory can not beoverwritten, a write command is therefore converted into three steps:read, internal erasing, data merge and writing back.

An electronic flash memory external storage device, which comprisesstorage media and DC power supply, is designed and implemented. Allparts and PCB (printed circuit board) used for the external storagedevice are assembled as a monolithic piece. It uses software toimplement external storage functions. The external storage device,including all of its parts, is physically at a standstill during theprocess of access.

There is an access control circuit on said PCB, which comprisesmicroprocessor, USB interface controller, USB connector andsuspend/resume circuit. Said storage media is flash memory. Saidmicroprocessor is connected with USB interface controller,suspend/resume circuit and flash memory respectively. The USB interfacecontroller is connected with USB connector, suspend/resume circuit,flash memory and microprocessor respectively. The USB connector isconnected with data processing host machine through USB cable.

Said external storage device is driven by the driver and the firmware.The firmware resides in the microprocessor and the driver is loadedbetween upper layer operating system and lower layer operating system ofthe host computer.

An application example of the external storage device is to utilize itin data processing system. The device is connected with the systemthrough universal bus interface. Driver for the external storage deviceis installed in the operating system of the data processing system.Under the management of the operating system, users can operate theexternal storage device the same way operating a classical disk. Thedriver receives standard disk operation requests from operating systemand converts the requests into special instructions for the externalstorage device. The driver then sends the converted instructions to thefirmware through bottom layer operating system and universal businterface control circuit. The firmware executes the instructions andsends results and status back to the driver through the operatingsystem. Up to this point, the data exchange procedure between theexternal storage device and data processing system is completed. Therecognition procedure of the external device when it is plugged into thehost machine includes device plug-in, device registration and allocationof device symbol. The external storage device is plug-and-play withoutshutting down the host machine when plugging in or pulling out thedevice.

BRIEF DESCRIPTION OF THE ACCOMPANYING DRAWINGS

FIG. 1 shows the general hardware block diagram of the electronic flashmemory external storage device of the present invention.

FIG. 2 shows a hardware section diagram of the electronic flash memoryexternal storage device.

FIG. 3 shows the hardware block diagram of the electronic flash memoryexternal storage device implemented with USB interface.

FIG. 4 shows the hardware block diagram of the electronic flash memoryexternal storage device implemented with IEEE1394 interface.

FIG. 5 shows the software block diagram of the electronic flash memoryexternal storage device.

FIG. 6 shows circuit schematics of the electronic flash memory externalstorage device implemented with USB interface.

FIG. 7 shows the driver flowchart.

FIG. 8 shows the firmware flowchart.

DETAILED DESCRIPTION OF THE INVENTION

Following is the description of a preferred embodiment of the presentinvention, which description should be taken in conjunction with theaccompanying drawings.

An electronic flash memory external storage method, which includes theuse of DC power supply and storage media, wherein with the followingcharacteristics:

-   -   said storage media is flash memory;    -   all components and PCB (printed circuit board) used are        assembled as a monolithic piece;    -   said storage method uses software to implement external storage        functions (to replace physical drive); and    -   every part is physically at a standstill during the process of        access. Said storage method includes:    -   the establishment of data exchange channel between data        processing host computer and external storage device;    -   connecting method of the power supply source;    -   method of setting up physical storage media of the external        storage device and its internal data structure;    -   method of reading and writing the external storage media; method        of interpreting and executing read and write commands;    -   method of transferring data between the host computer and the        external storage device;    -   installation procedures of driver of the external storage        device; and    -   method of data exchange between the host machine operating        system and said driver.

Said storage method also includes a firmware that resides in theelectronic flash memory external device and directly controls the accessof flash memory and implements standard interface functions. Thefirmware resides in the microprocessor and works according to thefirmware flowchart as shown in FIG. 8. When the external storage deviceis plugged into the data processing a host computer, the firmwarecoordinates with the driver in the operating system to accomplish theinitialization of the device (step 1), then waits for the operationrequest (step 2). According to the requirements of operating system andthe driver, if the request is a interface standard operation, thefirmware executes standard interface operation instructions and returnsback the processing result or status information etc. (steps 3, 4, 5);If not but a special operation for the external storage device, thefirmware executes the special operation instructions and returns backthe processing result or status information etc. (steps 3, 6, 7, 8); orelse the firmware ignores the operation request and returns back to step2.

Said driver works according to the software flowchart for the driver asshown in FIG. 7. When the external storage device is plugged into thedata processing host machine, the driver coordinates with the firmwareto accomplish the initialization of the device and notifies theoperating system to assign and display a device symbol for the externalstorage device. The driver also needs to process the operation requestssent from the operating system to the external storage device. Atpresent, the operation request is mainly in magnetic disk operationformat. It needs to be converted by the driver into special operationinstruction for the external storage device, packaged in the formatdefined by the universal bus standards and sent to the firmware forexecution. In addition, the driver needs to accomplish plug-and-play andcoordinates with the operating system. Once the external storage deviceis pulled out, the driver will immediately notify the operating systemto remove the corresponding device symbol of the external storagedevice.

Said storage method, which can be applied to all data processing systemssupporting universal bus, includes the following contents:

The data exchange channel between said data processing system hostmachine and the external storage device is universal bus. It does notneed extra interface card, big physical drive or mechanical movingparts. It is light in weight, quick to start up and plug and play. Theworking power for the device is supplied from the universal bus. Noextra external power supply is needed. It is convenient and easy to use.At present, the universal bus adopted is USB (Universal Serial Bus). USBis a new international standard for computer peripheral devices, whichcan replace the legacy parallel ports, serial ports, keyboard interfaceand mouse interface etc. The purpose of USB is to provide unifiedinterface for computer peripheral devices, to improve transferringspeed, to increase number of connectable devices, to increasetransferring distance and to facilitate computer users. Today manycomputer peripheral devices such as scanner, printer, digital camera,keyboard and mouse have adopted USB interface.

The storage media of said external storage device is flash memory. Thisflash memory is a kind of large-capacity electronic memory chip withsmall size and high speed. Data of the flash memory can be randomly orsequentially read and written. Data can also be erased. Erasingoperation is in unit of data block, which can be erased for up to 1million times. Flash memory is an excellent data storage media with thecapability to store data for more than 10 years without power supply.This kind of flash memory has another feature that if the target memoryarea of a write operation contains valid data, the valid data in thismemory area must be read out first before the memory area will be erasedand then the new data can be successfully written in, wherein said validdata is the useful data that should be saved an can not be erased. Thisfeature is perfect to protect the valid data in the flash memory thoughit makes the write operation more complicated. The capacity of anexternal storage device using flash memory is normally five to six timeslarger than a floppy disk. The data inside the flash memory is organizedin a uniform block model. At present, one data block of the flash memoryprovides 8K bytes, 16K bytes or 32 k bytes or even 128K bytes availablestorage capacity. With the advancement of technology, flash memory witheven bigger capacity in a single block will probably be available forexternal storage device.

Said read command for the external storage device comprises thefollowing steps:

-   -   upper layer operating system receives the read command from        user, wherein the command format is the familiar format used by        legacy magnetic disk;    -   operating system sends said read command to the driver;    -   the driver converts the read command used by magnetic disk        operation into special read instruction which can be understood        and executed by the firmware and transfers said converted read        instruction to bottom layer operating system;    -   bottom layer operating system transfers said converted read        instruction to the firmware through control circuit of the        universal bus; and the firmware executes said converted read        instruction, and transfers results and status back to the driver        through operating system.

Said write command of the external storage device comprises thefollowing steps:

-   -   operating system receives the write command from user, wherein        the command format is the familiar format used by legacy        magnetic disk;    -   operating system sends said write command to the driver;    -   the driver checks whether the external storage device has write        protection or not, if no write protection status or not, the        driver continues to execute the following steps;    -   the driver converts the write command used by magnetic disk        operation into several special instructions which can be        understood and executed by the firmware, and transfers said        converted instructions one by one to bottom layer operating        system;    -   bottom layer operating system transfers said converted        instructions to the firmware through control circuit of the        universal bus;    -   the firmware executes a read instruction to the target memory        area of the write command and transfers data read out back to        the driver through operating system;    -   the firmware executes an erase instruction to said target memory        area and transfers erase result back to the driver through        operating system;    -   the driver merges the data read out and the data to be written        to said target memory area, and sends the merged data and a        write instruction to the firmware, then the firmware writes the        merged data back to said target memory area; and    -   the firmware transfers write operation results and status back        to the driver through the operating system.

The data exchange method between the data processing system and theexternal storage device is the standard method defined by the universalbus specifications, not the specifically self-defined internal methodfor the external storage device. Driver or firmware packages dataaccording to the standard communication protocol before the data istransferred from driver to firmware or from firmware to driver.

Said working power of the external storage device is supplied from USBinstead of special power supply from the system. This power supplyscheme eliminates power adapter and maximizes the convenience ofplug-and-play.

In other examples of implementation, the standard IEEE1394 bus can beadopted as the data exchange channel between the data processing hostmachine and the external storage device. In this case, working power ofthe external storage device can be provided from IEEE1394 bus and thedata exchange method between the data processing host machine and theexternal storage device is the standard method defined by IEEE1394.

The present invention uniquely designs a toggle switch that is connectedto the write protection pin WP of flash memory. The status of the writeprotection pin is either pending or connected to ground by the switch.Write protection function of the external storage device is jointlyimplemented by the WP pin and the firmware detection of the WP pinstatus. The write protection pin WP has hardware write protectionfunction, that is, it can physically protect the contents of the flashmemory from being modified or erased. On the other hand, driver andfirmware provide software write protection function for the externalstorage device. When the WP pin is at the write protection status (WPpin is connected to ground), the firmware notifies this status to thedriver and the driver in turn notifies this status to the operatingsystem. As a result, the contents in the flash memory can not bemodified or erased and the data saved by the users can be protected.Especially in this case, the external storage device is impossible to beinfected by virus.

The general hardware block diagram of the external storage device of thepresent invention is shown in FIG. 1. FIG. 1 shows a Flash Memory 1, anAccess Control Circuit 2, and a Write Protection Switch 4. FIG. 2 showsthe hardware section diagram of the external storage device using USBinterface 231. Said storage device is completely contained inside asingle casing 5. All components are mounted on a PCB 51 that iscontained in the casing 5. The device uses software to implement datastorage access functions. The external storage device and its every partare physically at a standstill when the device is at working state.

A flash memory 1, a DC-DC voltage regulator 3 and an access controlcircuit 2 are mounted on the PCB 51 of the external storage device.Because the flash memory 1 and the access control circuit 2 onlycomprise electronic components without any mechanical moving parts, theexternal storage device can be very small, almost the same size of athumb, and it is very convenient in using and carrying.

FIG. 3 shows the hardware block diagram of the external storage deviceof the present preferred embodiment implemented with USB interface 231.The access control circuit 2 includes a microprocessor 21, a USBinterface controller 221, a USB interface 231 and a suspend/resumecircuit 24. The storage media is the flash memory 1. The microprocessor21 is connected with the USB interface controller 221, thesuspend/resume circuit 24 and the flash memory 1, with signal flowing inuni-direction or bi-direction. The USB interface controller 221 isrespectively connected with the USB connector 231, the suspend/resumecircuit 24 and the flash memory 1, with signal flowing in uni-directionor bi-direction. The USB interface 231 is connected with the dataprocessing system through USB cable. A write protection switch 4 isconnected with the flash memory 1 and the microprocessor 21, with signalflowing in uni-direction.

The power supply of the DC-DC voltage regulator 3 is provided from theUSB interface 231, and is connected with the microprocessor 21, the USBinterface controller 221 and the suspend/resume circuit 24. The outputpin of the DC-DC voltage regulator 3 is connected with the power supplypin of the flash memory 1.

Today almost all Pentium II or above computers (including compatiblecomputers) are equipped with USB interface. USB has become the newindustry standard of personal computer. Therefore, many computers cansupport the electronic flash memory external storage device of thepresent invention. Like floppy disk and CDROM, the external storagedevice will probably become a standard computer peripheral and willeventually replace floppy disk and floppy drive.

FIG. 4 shows the hardware block diagram of the external storage deviceof the present preferred embodiment implemented with IEEE1394 interface,wherein the universal bus interface is IEEE1394 interface 232, and theuniversal bus interface controller is IEEE1394 interface controller 222.

FIG. 6, the corresponding figure of FIG. 3, shows the circuit schematicsof the external storage device of the present preferred embodiment. Themicroprocessor 21 is used to control the USB interface controller 221,the flash memory 1 and the suspend/resume circuit 24. The microprocessor21 comprises a microprocessing chip D4 and two 4053 analogmultiplexer/de-multiplexer chips D5 and D6. Pin 12, 1 and 3 of the chipD5 and pin 12 of the chip D6 are connected together and then to pin 12of the chip D4. Pin 13, 2, 5 of the chip D5 and pin 13 of the chip D6are connected together and then to pin 13 of the chip D4. Pin 11, 10, 9of the chip D5 and pin 11 of the chip D6 are respectively connected topin 44, 1, 2 and 3 of the chip D4. DATA0 to DATA7 of the chip D4 arerespectively connected to the corresponding data bus of chip D2 of theUSB interface controller 221 and chip D1 of the flash memory 1. Pin 4 ofthe chip D5 is connected to pin 4 of the flash memory chip D1. Pin 14 ofthe chip D6 is connected to pin 42 of the flash memory chip D1. Pin 14and 15 of the chip D5 are respectively connected to pin 15 and 16 of thechip D2.

Said USB interface controller 221 comprises a chip D2 with part numberPDIUSBD12, a crystal oscillator Y1, capacitors C1-C2 and C7-C8,resistors R1-R3 and R10, and a LED V3. The crystal oscillator Y1 and thecapacitors C1 and C2 are serially connected as a closed circuit. The twopins of the crystal oscillator Y1 are respectively connected to pin 22and 23 of the chip D2. Pin 25 and 26 of the chip D2 are respectivelyconnected to pin 2 and pin 3 of the USB connector 231 through theresistors R2 and R1. The USB interface controller 221 is responsible forUSB data input, data output and data flow control. It is compliant toUSB Specifications 1.0 and 1.1. The USB interface controller 221 has an8-bit high-speed and yet simple parallel bus interface capable ofinterfacing with most microprocessor, and also supports DMA function.

The flash memory 1 is used for data storage. The part numbers of theflash memory chip D1 can be TC58V64FT/128FT/256FT/512FT orKM29V64000T/128T/256T/512T. Pin 5 of the chip D1 is connected to pin 5of the write protection switch 4.

The purpose of the suspend/resume circuit 24 is to reduce powerconsumption. It can switch the external storage device from workingstate to suspend state, or can wake up the external storage device fromsuspend state to normal working state. It comprises a transistor V1, acapacitor C4, a diode V2 and resistors R5-R9. The base of the transistorV1 is connected to pin 12 of the chip D2 of the USB interface controller221 through the resistor R9, the capacitor C4 and the resistor R8. Theemitter of the transistor V1 is connected to pin 4 of the microprocessorchip D4.

The electronic flash memory external storage device of the presentinvention does not need physical drive and extra external power supply.It is completely driven by software, that is, driven by the driver andthe firmware. The firmware resides in the microprocessor 21 andinteracts with bottom layer operating system. The driver is loadedbetween bottom layer operating system, and interacts with bottom layeroperating system and upper layer operating system. The software blockdiagram of the driver is shown in FIG. 5. The software block diagram ofFIG. 5 includes an upper layer operating system 5.1, a flash electronicmemory external storage device driver 5.2, a bottom layer operatingsystem 5.3, and a flash electronic memory external firmware 5.4.

The software flowcharts of the driver and the firmware are shown in FIG.7 and FIG. 8 respectively. FIG. 7 shows an initialization block 7.1,notify the operating system to assign an external storage driver block7.2, a waiting for operation request block 7.3, an operation of themagnetic disk block 7.4, a plug-and-play or other supportable operationblock 7.5, a processing operation block 7.6, a return process inform ofresult or state etc. block 7.7, a specific operation for convertingmagnetic disc operation into electronic flash memory external storagedevice block 7.8, a specifically operate electronic flash memoryexternal storage device to package it in the format defined by USB block7.9, a send the packaged operation to the firmware via the operationsystem and wait for operation return block 7.10, a return processinformation of result or state etc. block 7.11, and a notify theoperating system to remove the movable storage device block 7.12. FIG. 8shows an initialization block 8.1, a waiting for operation request block8.2, a standard USB operation block 8.3, a special operation for theflash electronic external storage device block 8.4, a process thespecial operation request for the flash electronic external storagedevice block 8.5, a return process information of result or state etc.block 8.6, a process standard USB operation request 8.7, and a returnprocess information of result or state etc. 8.8. The inventors of thepresent invention are preparing to apply to China Software RegistrationCenter for the copyright protection of the driver and the firmware.

When the user plugs the external storage device into the USB port of thecomputer, the microprocessor 21 immediately starts the execution of thefirmware resided in the microprocessor 21. The firmware firstly executesinitialization operations. After the initialization, the firmware entersinto waiting state to wait for further operation requests.

All initialization code of the firmware is stored in the microprocessorchip D4. When the external storage device is powered up, the operatingsystem inquiries the USB interface chip D2. In response to the inquiry,the chip D2 generates interrupt requests to the microprocessor chip D4.The chip D4 establishes the connection with the operating system byresponding to the interrupt requests of D2. Basing on the feedback ofvarious device status and flags from the chips D2 and D4 of the externalstorage device, the operating system in turn notifies the chips D2 andD4 to finish the initialization and to be prepared for normal dataexchange at the next stage.

Through the USB interface, the operating system is able to automaticallydetect the existence of any new external storage device whenever it isplugged in. In this case, upper layer operating system immediatelyactivates the driver. When the driver is activated, it executesinitialization operations and instructs the operating system to create aremovable storage device (or movable storage device) for the externalstorage device. After the operating system receives the instruction, itgenerates a removable storage device and assigns a corresponding drivesymbol for each external storage device plugged in. During the aboveoperating process, the firmware receives and processes operationrequests from the driver and the operating system. When the driverfinishes the processing of the plug-in operation, it enters into waitingstate to wait for further operation requests.

When the user pulls out an external storage device from the USB port ofthe computer, the firmware terminates its execution immediately. In thiscase, the operating system can automatically detect that the device hasbeen pulled out from the computer, and immediately notifies the driverof this event. After the driver receives the notification, itimmediately executes the relevant operations and instructs the operatingsystem to remove the removable storage device corresponding to theexternal storage device that has been pulled out. After the operatingsystem receives the instruction, it removes the corresponding removablestorage device and drive symbol immediately.

When the upper layer of the operating system receives a read command, itpasses the read command to the driver. Because the format of the readcommand is the standard magnetic disk operation format which isdifferent from the operation format of USB and flash memory, the driverconverts the read command into the special instruction for theelectronic flash memory external storage device. After the conversion,the driver again packages the converted instruction into USB packets,and sends the packaged read instruction to bottom layer operatingsystem. Bottom layer operating system in turn sends the read instructionthrough the USB interface to the firmware running in the microprocessorof the electronic flash memory external storage device. The firmwareexecutes the read instruction and sends the read data and status back tothe driver through bottom layer operating system. Then the driver sendsthe read data and status to upper layer operating system. Up to thispoint, the process of the read command is finished.

When the data processing system requests to read data, the USB interfacecontroller chip D2 notifies the microprocessor chip D4. According to therequest of the operation system, the microprocessor chip D4 reads therequested data from the flash memory D1, and sends the data back to thechip D2. The chip D2 in turn sends the requested data back to the dataprocessing system.

When upper layer operating system receives a write command, it passesthe write command to the driver. Because the format of the write commandis the standard magnetic disk operation format which is different fromthe operation format of USB and flash memory, the driver converts thewrite command into special instructions for the electronic flash memoryexternal storage device. The new data of the write command can not besuccessfully written into the flash memory if the target memory area ofthe flash memory contains valid data. In this case, the target memoryarea must be erased before any new data can be successfully written intothe same memory area. Because of this characteristic of the flashmemory, the driver converts the write command into three differentinternal instructions: read, erase and write. Firstly the driverexecutes the internal read instruction to read out the valid dataalready contained in the target memory area of the write command, andstores the read data into an internal buffer of the driver. Then thedriver executes the internal erase command to erase all data containedin the said target memory area. Finally, the driver merges the new dataneed to write into the target memory area with the data saved in theinternal buffer of the driver, and executes the internal writeinstruction to write the merged data into the said target memory area ofthe flash memory. After the above three internal instructions have beencompleted, the driver sends the operation status to upper layeroperating system. Up to this point, the process of the write command isfinished.

When the data processing system requests to write data into the flashmemory 1 i.e. D1, the USB interface controller chip D2 notifies themicroprocessor chip D4. According to the request of the operationsystem, the microprocessor chip D4 reads corresponding data from thechip D2 and writes the data into the flash memory D1.

When the operating system requests the external storage device to erasethe flash memory, the USB interface controller chip D2 notifies themicroprocessor chip D4. Upon receiving the notification, themicroprocessor chip D4 sends a sequence of instructions to the flashmemory D1 to erase the contents of the target memory area in flashmemory D1.

In this preferred embodiment, the driver packages the above said threeinternal instructions into USB packets and respectively sends each USBpacket to bottom layer operating system. Bottom layer operating systemin turn sends the USB packets through USB interface to the firmwareresided in the microprocessor. The firmware executes the instructionsand sends the data and status back to bottom layer operating systemthrough the USB interface. Then bottom layer operating system sends thedata and status to the driver. Furthermore, said firmware alsoimplements the special operation of the external storage device.

The electronic flash memory external storage device of the presentinvention includes universal bus interface controller and interfaceconnector, electronic flash memory, suspend/resume circuit, the powersupply obtained from the universal bus, and microprocessor. Themicroprocessor directly controls the access to the storage media of thedevice and includes a firmware that implements standard functions. Theexternal storage device is supported by the driver installed in theoperating system and is supported by system hardware, and has thefollowing characteristics:

Said external storage device of the present invention is used as theexternal storage device of data processing system.

Said external storage device of the present invention can also be usedas the external storage device of digital micro-computer. Today USB isthe standard configuration of Pentium II and compatible computers. Thewide acceptance of electronic flash memory external storage device ofthe present invention can be expected soon.

Said external storage device of the present invention can also be usedas the external storage device of handheld device. This kind of producthas been expected for a long time by the users of the popular PDA(personal digital assistant) and other handheld devices.

In addition, said external storage device of the present invention canalso be used as the external storage device of portable data processingsystem. Users of portable data processing system such asnotebook/sub-notebook computers have been working without effectiveexternal storage device for many years due to the big size of floppydisk drive. Now their long expectation to have a good external storagedevice can be satisfied by our external storage device of the presentinvention.

Compared with current technologies, the electronic flash memory externalstorage method and device of the present invention used in dataprocessing system has the following advantages:

It uses flash memory as storage media and uses universal bus. The deviceis a removable external storage device that does not need any physicaldrive and extra external power supply. It is plug-and-play withoutshutting down the host machine. The speed of the device is fast and itscapacity is several times, tens of times, hundreds of times, thousandsof times or even higher, of the capacity of floppy disk. It is small,very easy to carry and hard to be damaged. Data retention of the devicecan be 10 years or even longer. It can be erased for 1 million times ormore. More than 20 such devices can be simultaneously connected to thecomputer. The method and the device of the present invention areapplicable to any data processing system that supports universal bus.

The part numbers and specifications of the main components used in thepreferred embodiment of the present invention are listed as follows:

Symbol Name Part Number Supplier D1 flash memory TC58V64FT/128FT/256FT/TOSHIBA 512FT or KM29U64000T/128T/256T/ SAMSUNG 512T D2 USB interfacePDIUSBD12 controller D3 DC--DC voltage X62FP3302 regulator D4microprocessor 8051/series INTEL D5, D6 analog CD4053 multiplexer/de-multiplexer Y1 crystal oscillator 6 MHz J1 USB connector C1-C8 capacitorR1-R10 resistor V1 transistor V2 LED V3 diode

1-20. (canceled)
 21. A device comprising: at least one flash memorymodule built-in said device; a USB or IEEE 1394 connector; amicroprocessor for processing commands to directly access data orinformation stored in the said flash memory module; and a circuitconnected with said USB or IEEE 1394 connector and said flash memorymodule, through which a DC power supply is provided from said hostcomputer through said USB or IEEE 1394 connector to said flash memorymodule and said microprocessor upon connecting said portable flashmemory storage device with said host computer, wherein said portableflash memory storage device only acquires DC power from the hostcomputer through said USB or IEEE 1394 connector; and wherein saidmicroprocessor coordinates with a device driver specifically developedfor the device in the host computer to display a device symbol for saiddevice upon connecting said USB or IEEE 1394 connector to the hostcomputer.
 22. The device according to claim 21, further comprises asuspend/resume circuit, connected with said flash memory module, forreducing the consumption of DC power supply from the host computerthrough said USB or IEEE 1394 connector.
 23. The device according toclaim 22, wherein said suspend/resume circuit further comprises aswitching circuit for automatically changing between a suspend operationand a resume operation.
 24. The device according to claim 21, furthercomprising a write protection circuit, connected with said flash memorymodule, for protecting against unwanted write operations.
 25. The deviceaccording to claim 24, wherein said write protection circuit furthercomprises a toggle switch, connected to a write protection pin of theflash memory module, for changing a status of the write protection pinof said flash memory module.
 26. The device according to claim 21,wherein the device driver is capable of converting a request resultingfrom a user action on the device symbol into a special operationinstruction for said flash memory module.
 27. The device according toclaim 21, further comprising a firmware, wherein the firmware and thedevice driver together provide a software write protection for saidportable flash memory storage device.
 28. The device according to claim21, wherein said firmware performs read, write or erase operations onthe flash memory module on a block basis in response to a user'srequest.
 29. The device according to claim 28, wherein the writeoperation performed by the firmware further comprises an operation toread out data in a partially-written block; an operation to erase thepartially-written block; an operation to merge the read-out data withnew data to be written; and an operation to write the merged data intothe erased block.
 30. The device according to claim 21, wherein the hostcomputer automatically detects the device when it is plugged in andactivates the device driver, and wherein the device driver executesinitialization operations and instructs the host computer's operatingsystem to create a device symbol representing a removable storagedevice.
 31. The device according to claim 21, wherein saidmicroprocessor coordinates with the device driver to accomplishinitialization of the device when the device is plugged into the USB orIEEE1394 port of the host computer.
 32. The device according to claim21, wherein said device symbol enables a user to directly access thedevice without any communication protocol conversion.
 33. The deviceaccording to claim 21, wherein said user requests to access the flashmemory module are received by the firmware without any communicationprotocol conversion.
 34. The device according to claim 21, wherein thefirmware receives an operation request from either the device driver orthe host computer's operating system which indicates the presence of adevice symbol on the host computer and wherein said device symbolenables a user to operate the portable flash memory storage device inthe same way as a magnetic disk.
 35. The device according to claim 21,wherein said firmware is enabled to receive a special operationinstruction from the device driver in the host computer, the specialoperation instruction having been converted from a user request inmagnetic disk operation format.
 36. The device according to claim 35,wherein the special operation instruction was converted from a userrequest in magnetic disk operation format without a communicationprotocol conversion.
 37. The device according to claim 36, wherein thespecial operation instruction further includes an erase commandrequiring an erase of a partially-written block and the firmware isenabled to read out any data to be saved in the partially-written blockprior to erasing the partially-written block.
 38. The device accordingto claim 37, wherein the data read out of the partially-written blockcan be merged with new data to be written to the erased block.
 39. Thedevice according to claim 38, wherein the merged data is written to theerased block.
 40. A computer comprising a device driver specificallydeveloped for the device of claim 21, wherein said device driver iscapable of converting a request resulting from a user action on thedevice symbol into a special operation instruction for said flash memorymodule.